<div class="sf_admin_list">
  <?php if (!count($solicitudes)): ?>
    <p><?php echo __('No hay solicitudes que puedan ser otorgadas.', array(), 'sf_admin') ?></p>
  <?php else: ?>
    <table cellspacing="0"> 
      <thead>
        <tr>
          <th id="sf_admin_list_batch_actions"><input id="sf_admin_list_batch_checkbox" type="checkbox" onclick="checkAll();" /></th>
          <th class="sf_admin_text sf_admin_list_th_alumno">Alumno</th>
          <th class="sf_admin_text sf_admin_list_th_sede">Sede</th>
          <th class="sf_admin_date sf_admin_list_th_fecha">Fecha Solicitud</th>
        </tr>
      </thead>
      <tfoot>
        <tr>
          <th colspan="7">
            <?php echo format_number_choice(
                          '[0] no result|[1] 1 result|(1,+Inf] %1% results', 
                          array('%1%' => count($solicitudes)),
                          count($solicitudes),
                          'sf_admin'
                       ) ?>
          </th>
        </tr>
      </tfoot>
      <tbody>
        <?php
              $seleccionados = $sf_data->getRaw('seleccionados');
              foreach($solicitudes as $i => $solicitud): 
                $odd = fmod(++$i, 2) ? 'odd' : 'even' ?>
                <tr class="sf_admin_row <?php echo $odd ?>">
                   <td>
                     <input type="checkbox" name="ids[]" value="<?php echo $solicitud->getId() ?>" class="sf_admin_batch_checkbox"
                        <?php if(in_array($solicitud->getId(), $seleccionados)) echo 'checked="checked"'; ?>
                     />
                   </td>
                   <td class="sf_admin_text sf_admin_list_td_alumno">
                     <?php echo $solicitud->getAlumno() ?>
                   </td>
                   <td class="sf_admin_text sf_admin_list_td_alumno">
                     <?php echo $solicitud->getAlumno()->getSede() ?>
                   </td>
                   <td class="sf_admin_date sf_admin_list_td_fecha">
                     <?php echo false !== strtotime($solicitud->getFecha()) ? format_date($solicitud->getFecha(), "dd-MMM-y") : '&nbsp;' ?>
                   </td>
                </tr>
        <?php endforeach; ?>
      </tbody>
    </table>
  <?php endif; ?>
</div>
<script type="text/javascript">
/* <![CDATA[ */
function checkAll()
{
  var boxes = document.getElementsByTagName('input'); for(var index = 0; index < boxes.length; index++) { box = boxes[index]; if (box.type == 'checkbox' && box.className == 'sf_admin_batch_checkbox') box.checked = document.getElementById('sf_admin_list_batch_checkbox').checked } return true;
}
/* ]]> */
</script>
